package com.daoeping.data;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Usr_projectexperience entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "usr_projectexperience", catalog = "daoeping")
public class Usr_projectexperience implements java.io.Serializable {

	// Fields

	private Integer id;
	private Bsc_department bsc_department;
	private Bsc_jobtype bsc_jobtype;
	private Bsc_jobtitle bsc_jobtitle;
	private Usr_workexperience usr_workexperience;
	private String name;
	private Date startDate;
	private Date endDate;
	private String description;
	private Set<Usr_industryref> usr_industryrefs = new HashSet<Usr_industryref>(
			0);
	private Set<Usr_techincref> usr_techincrefs = new HashSet<Usr_techincref>(0);

	// Constructors

	/** default constructor */
	public Usr_projectexperience() {
	}

	/** minimal constructor */
	public Usr_projectexperience(Bsc_department bsc_department,
			Bsc_jobtype bsc_jobtype, Bsc_jobtitle bsc_jobtitle,
			Usr_workexperience usr_workexperience) {
		this.bsc_department = bsc_department;
		this.bsc_jobtype = bsc_jobtype;
		this.bsc_jobtitle = bsc_jobtitle;
		this.usr_workexperience = usr_workexperience;
	}

	/** full constructor */
	public Usr_projectexperience(Bsc_department bsc_department,
			Bsc_jobtype bsc_jobtype, Bsc_jobtitle bsc_jobtitle,
			Usr_workexperience usr_workexperience, String name, Date startDate,
			Date endDate, String description,
			Set<Usr_industryref> usr_industryrefs,
			Set<Usr_techincref> usr_techincrefs) {
		this.bsc_department = bsc_department;
		this.bsc_jobtype = bsc_jobtype;
		this.bsc_jobtitle = bsc_jobtitle;
		this.usr_workexperience = usr_workexperience;
		this.name = name;
		this.startDate = startDate;
		this.endDate = endDate;
		this.description = description;
		this.usr_industryrefs = usr_industryrefs;
		this.usr_techincrefs = usr_techincrefs;
	}

	// Property accessors
	@Id
	@GeneratedValue
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "department_id", nullable = false)
	public Bsc_department getBsc_department() {
		return this.bsc_department;
	}

	public void setBsc_department(Bsc_department bsc_department) {
		this.bsc_department = bsc_department;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "jobtype_id", nullable = false)
	public Bsc_jobtype getBsc_jobtype() {
		return this.bsc_jobtype;
	}

	public void setBsc_jobtype(Bsc_jobtype bsc_jobtype) {
		this.bsc_jobtype = bsc_jobtype;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "jobtitle_id", nullable = false)
	public Bsc_jobtitle getBsc_jobtitle() {
		return this.bsc_jobtitle;
	}

	public void setBsc_jobtitle(Bsc_jobtitle bsc_jobtitle) {
		this.bsc_jobtitle = bsc_jobtitle;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "work_exp_id", nullable = false)
	public Usr_workexperience getUsr_workexperience() {
		return this.usr_workexperience;
	}

	public void setUsr_workexperience(Usr_workexperience usr_workexperience) {
		this.usr_workexperience = usr_workexperience;
	}

	@Column(name = "name", length = 45)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "start_date", length = 10)
	public Date getStartDate() {
		return this.startDate;
	}

	public void setStartDate(Date startDate) {
		this.startDate = startDate;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "end_date", length = 10)
	public Date getEndDate() {
		return this.endDate;
	}

	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}

	@Column(name = "description", length = 500)
	public String getDescription() {
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "usr_projectexperience")
	public Set<Usr_industryref> getUsr_industryrefs() {
		return this.usr_industryrefs;
	}

	public void setUsr_industryrefs(Set<Usr_industryref> usr_industryrefs) {
		this.usr_industryrefs = usr_industryrefs;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "usr_projectexperience")
	public Set<Usr_techincref> getUsr_techincrefs() {
		return this.usr_techincrefs;
	}

	public void setUsr_techincrefs(Set<Usr_techincref> usr_techincrefs) {
		this.usr_techincrefs = usr_techincrefs;
	}

}